/**
 * @author 
 * @time 2022-04-21 11PM
 * @description 定义购物车的数据接口
 */
 import Ajax from './Ajax'

/**
 * 获取购物车信息
 * @param {string} userId 用户编码
 * @returns 
 */
 function cartListApi(userId) {
    return Ajax({
        url: '/cart/' + userId,
        
        method: 'GET',
        
    })
}

function cartDeleteApi(data) {
    return Ajax({
        url: '/cart/delete',
        method: 'DELETE',
        data
    })
}
/**
 * 修改购物车信息
 * @param {userId: string, id: string, count: number} params 
 * @returns 
 */
 function cartModifyApi(data) {
    return Ajax({
        url: '/cart/modify',
       
        data
    })
}

export {
    
    cartListApi,
    cartDeleteApi,
    cartModifyApi,

}